<?php

  $Type = substr($pct->getParam('task'),0,1);
  $NewsId = substr($pct->getParam('task'),1);
  $query = "
  			SELECT n.title".__FLANG." AS title, n.linkname, DATE_FORMAT(n.p_date, '%Y/%m/%d') AS date
  			FROM ".$_SQL_TABLE['news']." n
  			WHERE id = ".$dbSet->quoteValue($NewsId)."
  ";
  $dbSet->open($query);
  $News = $dbSet->fetchArray();
  $title = $News['title'];
  $link = $BaseURL.'news/'.$News['date'].'/'.$News['linkname'].$CONFIG['webPageFileType'];

  switch($Type)
  {    case 'f':
    			$URL = "http://www.facebook.com/sharer.php?u=".$link."&t=".urlencode($title);
    			break;
    case 't':
    			$URL = "http://twitter.com/home?status=".urldecode($title)." ".$link;
    			break;
    case 'l':
    			$URL = "http://www.livejournal.com/update.bml?subject=".urlencode($title)."&event=".$link;
    			break;
    default:
    			pageNotFound();

  }
  go_to($URL);
  exit;

?>